// 引入request模块
import request from '@/utils/request'

// 获取章节和课时 接口 /boss/course/section/getSectionAndLesson
export const getSectionAndLesson = courseId => {
  return request({
    method: 'GET',
    url: '/boss/course/section/getSectionAndLesson',
    params: {
      courseId
    }
  })
}
// 更新或保存章节 接口 /boss/course/section/saveOrUpdateSection
export const saveOrUpdateSection = data => {
  return request({
    method: 'POST',
    url: '/boss/course/section/saveOrUpdateSection',
    data
  })
}
// 保存或更新课时 /boss/course/lesson/saveOrUpdate
export const saveOrUpdateLesson = data => {
  return request({
    method: 'POST',
    url: '/boss/course/lesson/saveOrUpdate',
    data
  })
}
// 根据sectionId 获取当前编辑的章节 /boss/course/section/getBySectionId
export const getBySectionId = sectionId => {
  return request({
    method: 'GET',
    url: '/boss/course/section/getBySectionId',
    params: {
      sectionId
    }
  })
}
